//
//  MyTabController.m
//  UITestDemo
//
//  Created by Qianfeng on 15/8/14.
//  Copyright (c) 2015年 Qianfeng. All rights reserved.
//

#import "MyTabController.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
@interface MyTabController ()

@end

@implementation MyTabController

- (void)viewDidLoad {
    [self initUI];
}
-(void)initUI
{
    NSArray *className = @[@"FirstViewController",@"SecondViewController",@"ThirdViewController",@"FourthViewController",@"FiveViewController"];
    NSArray *title = @[@"第一页",@"第二页",@"第三页",@"第四页",@"第五页"];
    NSMutableArray *controllers = [[NSMutableArray alloc]init];
    
    for (int i = 0 ; i< className.count; i++) {
        Class cls = NSClassFromString(className[i]);
        UIViewController *viewController = [[cls alloc]init];
        viewController.title = title[i];
        viewController.navigationController.title = title[i];
        [controllers addObject:viewController];
        
    }
    self.viewControllers = controllers;
    FirstViewController *v1 = [self.viewControllers objectAtIndex:0];
    SecondViewController *v2 = [self.viewControllers objectAtIndex:1];
    v2.size = v1.slider.value;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
